package com.telecom.cms.service;

import java.util.List;
import com.telecom.cms.dao.*;
import com.telecom.cms.dto.*;


public class SysRoleMgr {
   
	public int save(SysRole sysrole){
		int result=(new SysRoleDAO()).insert(sysrole);
		return result;
	}
	
	public int savemainmenuauth(CampMenuAuth mainmenuauth){
		int result=(new CampMenuAuthDAO()).insert(mainmenuauth);
		return result;
	}
	
	public void delmainmenuauth(String roleid){
		(new CampMenuAuthDAO()).deleteByRole(Integer.parseInt(roleid));
	}
	
	public void delleftmenuauth(String roleid){
		(new CampLeftMenuAuthDAO()).deleteByRole(Integer.parseInt(roleid));
	}
	
	public int saveleftmenuauth(CampLeftMenuAuth leftmenuauth){
		int result=(new CampLeftMenuAuthDAO()).insert(leftmenuauth);
		return result;
	}
	
	public void delete(SysRole sysrole){
		(new SysRoleDAO()).delete(sysrole);
	}
	
	public List findall(){
		List result=(new SysRoleDAO()).findAll();
		return result;
	}
	
	public SysRole findbyid(String roleid){
		return (new SysRoleDAO()).findById(Integer.parseInt(roleid));
	}
}
